package com.vallis.statis;

import lombok.Data;

import java.util.Arrays;
import java.util.Objects;

/**
 * @author guozh
 * @Classname LotteryTicket
 * @Description TODO
 * @Date 2020/12/3 1:11
 * @Created by vallis
 */
@Data
public class LotteryTicket {
    private final String frontNum;
    private final String endNum;
    private int issue;
    private int price;
    private final int[] frontNumArray;
    private final int[] endNumArray;
    private int award;
    private int type;
    private AwardReport awardReport;
    
    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (o == null || getClass() != o.getClass()) {
            return false;
        }
        LotteryTicket that = (LotteryTicket) o;
    
        System.out.println(endNum);
        return issue == that.issue &&
                price == that.price &&
                frontNum.equals(that.frontNum) &&
                endNum.equals(that.endNum) &&
                Arrays.equals(frontNumArray, that.frontNumArray) &&
                Arrays.equals(endNumArray, that.endNumArray);
    }
    
    @Override
    public int hashCode() {
        int result = Objects.hash(frontNum, endNum, issue, price);
        result = 31 * result + Arrays.hashCode(frontNumArray);
        result = 31 * result + Arrays.hashCode(endNumArray);
        return result;
    }
}
